package com.example.ssmxuankeback.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import jakarta.validation.constraints.NotNull;

@Data
@TableName("user")
@Schema(name = "User", description = "用户表")
public class User implements Serializable {
    //entity拥有所有数据

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "学工号")
    private Long id;

    @Schema(description = "用户姓名")
    private String name;

    @Schema(description = "班级编号（学生-所属班级，老师-所管班级）")
    private Integer classId;

    @Schema(description = "性别(0-女,1-男)")
    private Integer gender;

    @Schema(description = "用户类型(0-学生,1-老师)")
    private Integer userType;

    @Schema(description = "手机号码")
    private String phone;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "创建时间", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "修改时间", hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}